package com.ruoyi.user.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 优惠券模板 coupon_templates
 */
public class CouponTemplate extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /** 优惠券ID */
    @Excel(name = "优惠券ID")
    private Long couponId;

    /** 优惠券名称 */
    @Excel(name = "优惠券名称")
    private String name;

    /** 类型：1-满减券，2-折扣券，3-代金券 */
    @Excel(name = "类型")
    private Integer type;

    /** 折扣值/金额 */
    @Excel(name = "折扣值/金额")
    private BigDecimal discountValue;

    /** 最低订单金额 */
    @Excel(name = "最低订单金额")
    private BigDecimal minOrderAmount;

    /** 最大折扣金额（折扣券时有效） */
    @Excel(name = "最大折扣金额")
    private BigDecimal maxDiscount;

    /** 适用区域ID */
    @Excel(name = "适用区域ID")
    private Long regionId;

    /** 适用商户ID */
    @Excel(name = "适用商户ID")
    private Long merchantId;

    /** 总数量 */
    @Excel(name = "总数量")
    private Integer totalQuantity;

    /** 已使用数量 */
    @Excel(name = "已使用数量")
    private Integer usedQuantity;

    /** 有效期开始 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "有效期开始", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date validFrom;

    /** 有效期结束 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "有效期结束", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date validTo;

    /** 状态：0-未启用，1-启用，2-已过期 */
    @Excel(name = "状态")
    private Integer status;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date createdAt;

    /** 更新时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date updatedAt;

    /** 删除时间（软删除） */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "删除时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date deletedAt;

    /** 预留字段1 */
    private String externField1;

    /** 预留字段2 */
    private String externField2;

    public Long getCouponId() { return couponId; }
    public void setCouponId(Long couponId) { this.couponId = couponId; }

    public String getName() { return name; }
    public void setName(String name) { this.name = name; }

    public Integer getType() { return type; }
    public void setType(Integer type) { this.type = type; }

    public BigDecimal getDiscountValue() { return discountValue; }
    public void setDiscountValue(BigDecimal discountValue) { this.discountValue = discountValue; }

    public BigDecimal getMinOrderAmount() { return minOrderAmount; }
    public void setMinOrderAmount(BigDecimal minOrderAmount) { this.minOrderAmount = minOrderAmount; }

    public BigDecimal getMaxDiscount() { return maxDiscount; }
    public void setMaxDiscount(BigDecimal maxDiscount) { this.maxDiscount = maxDiscount; }

    public Long getRegionId() { return regionId; }
    public void setRegionId(Long regionId) { this.regionId = regionId; }

    public Long getMerchantId() { return merchantId; }
    public void setMerchantId(Long merchantId) { this.merchantId = merchantId; }

    public Integer getTotalQuantity() { return totalQuantity; }
    public void setTotalQuantity(Integer totalQuantity) { this.totalQuantity = totalQuantity; }

    public Integer getUsedQuantity() { return usedQuantity; }
    public void setUsedQuantity(Integer usedQuantity) { this.usedQuantity = usedQuantity; }

    public Date getValidFrom() { return validFrom; }
    public void setValidFrom(Date validFrom) { this.validFrom = validFrom; }

    public Date getValidTo() { return validTo; }
    public void setValidTo(Date validTo) { this.validTo = validTo; }

    public Integer getStatus() { return status; }
    public void setStatus(Integer status) { this.status = status; }

    public Date getCreatedAt() { return createdAt; }
    public void setCreatedAt(Date createdAt) { this.createdAt = createdAt; }

    public Date getUpdatedAt() { return updatedAt; }
    public void setUpdatedAt(Date updatedAt) { this.updatedAt = updatedAt; }

    public Date getDeletedAt() { return deletedAt; }
    public void setDeletedAt(Date deletedAt) { this.deletedAt = deletedAt; }

    public String getExternField1() { return externField1; }
    public void setExternField1(String externField1) { this.externField1 = externField1; }

    public String getExternField2() { return externField2; }
    public void setExternField2(String externField2) { this.externField2 = externField2; }

    @Override
    public String toString() {
        return "CouponTemplate{" +
                "couponId=" + couponId +
                ", name='" + name + '\'' +
                ", type=" + type +
                ", discountValue=" + discountValue +
                ", minOrderAmount=" + minOrderAmount +
                ", maxDiscount=" + maxDiscount +
                ", regionId=" + regionId +
                ", merchantId=" + merchantId +
                ", totalQuantity=" + totalQuantity +
                ", usedQuantity=" + usedQuantity +
                ", validFrom=" + validFrom +
                ", validTo=" + validTo +
                ", status=" + status +
                ", createdAt=" + createdAt +
                ", updatedAt=" + updatedAt +
                ", deletedAt=" + deletedAt +
                ", externField1='" + externField1 + '\'' +
                ", externField2='" + externField2 + '\'' +
                '}';
    }
}